package com.matt.foundation.vo.course;

import com.matt.domain.course.CoursePlanClasses;
import com.matt.foundation.DO.ChildrenCourseItemDO;
import com.matt.foundation.DO.TeacherDO;
import com.matt.foundation.DO.AdviseDetailDO;
import lombok.Data;
import org.assertj.core.util.Lists;

import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

/**
 * *******************************
课程计划详情
 * *******************************
 */
@Data
public class PadCoursePlanDetailVo {

    private String coursePlanClassesId;

    private Integer templateType;

    private Integer courseType;

    private String topicName;

    private Date courseDate;

    private Date beginTime;

    private Integer prepareStatus;

    private Integer courseStatus;

    private String classesName;

    private String courseName;

    private String typeName;

    private Object courseTemplate;

    private List<AdviseDetailDO> adviseList;

    private List<TeacherDO> teacherList;

    private List<CourseItemVo> childrenList;

    private Date beginCourseTime;



    public static PadCoursePlanDetailVo ofNursery(Integer templateType, CoursePlanClasses coursePlan, List<AdviseDetailDO> adviseList, List<TeacherDO> teacherList, Object template, String classesName, String topicName) {
        PadCoursePlanDetailVo vo = new PadCoursePlanDetailVo();
        vo.setCoursePlanClassesId(coursePlan.getId());
        vo.setTemplateType(templateType);
        vo.setTopicName(topicName);
        vo.setCourseDate(coursePlan.getCourseDate());
        vo.setCourseType(coursePlan.getCourseType());
        vo.setBeginTime(coursePlan.getBeginTime());
        vo.setPrepareStatus(coursePlan.getPrepareStatus());
        vo.setCourseStatus(coursePlan.getCourseStatus());
        vo.setClassesName(classesName);
        vo.setCourseName(coursePlan.getCourseName());
        vo.setTypeName(coursePlan.getTypeName());
        vo.setCourseTemplate(template);
        vo.setChildrenList(Lists.newArrayList());
        vo.setAdviseList(adviseList);
        vo.setTeacherList(teacherList);
        vo.setBeginCourseTime(coursePlan.getBeginCourseTime());
        return vo;
    }

    public static PadCoursePlanDetailVo ofEarly(Integer templateType, CoursePlanClasses coursePlan, List<ChildrenCourseItemDO> itemList, List<AdviseDetailDO> adviseList, List<TeacherDO> teacherList, Object template, String classesName) {
        PadCoursePlanDetailVo vo = new PadCoursePlanDetailVo();
        vo.setCoursePlanClassesId(coursePlan.getId());
        vo.setTemplateType(templateType);
        vo.setTopicName("");
        vo.setCourseDate(coursePlan.getCourseDate());
        vo.setBeginTime(coursePlan.getBeginTime());
        vo.setCourseType(coursePlan.getCourseType());
        vo.setPrepareStatus(coursePlan.getPrepareStatus());
        vo.setCourseStatus(coursePlan.getCourseStatus());
        vo.setClassesName(classesName);
        vo.setCourseName(coursePlan.getCourseName());
        vo.setTypeName(coursePlan.getTypeName());
        vo.setCourseTemplate(template);
        vo.setChildrenList(itemList.stream().map(o->CourseItemVo.of(o)).collect(Collectors.toList()));
        vo.setAdviseList(adviseList);
        vo.setTeacherList(teacherList);
        vo.setBeginCourseTime(coursePlan.getBeginCourseTime());
        return vo;
    }
    
    public static PadCoursePlanDetailVo ofAreaBuild(Integer templateType, CoursePlanClasses coursePlan, List<ChildrenCourseItemDO> itemList, List<AdviseDetailDO> adviseList, List<TeacherDO> teacherList, Object template, String classesName) {
        PadCoursePlanDetailVo vo = new PadCoursePlanDetailVo();
        vo.setCoursePlanClassesId(coursePlan.getId());
        vo.setTemplateType(templateType);
        vo.setTopicName("");
        vo.setCourseDate(coursePlan.getCourseDate());
        vo.setBeginTime(coursePlan.getBeginTime());
        vo.setCourseType(coursePlan.getCourseType());
        vo.setPrepareStatus(coursePlan.getPrepareStatus());
        vo.setCourseStatus(coursePlan.getCourseStatus());
        vo.setClassesName(classesName);
        vo.setCourseName(coursePlan.getCourseName());
        vo.setTypeName(coursePlan.getTypeName());
        vo.setCourseTemplate(template);
        vo.setChildrenList(itemList.stream().map(o->CourseItemVo.of(o)).collect(Collectors.toList()));
        vo.setAdviseList(adviseList);
        vo.setTeacherList(teacherList);
        vo.setBeginCourseTime(coursePlan.getBeginCourseTime());
        return vo;
    }
}
